package my.test.factoryMethodPattern.staticFactory;

import my.test.factoryMethodPattern.BlackHuman;
import my.test.factoryMethodPattern.Human;
import my.test.factoryMethodPattern.WhiteHuman;
import my.test.factoryMethodPattern.YellowHunam;

public class NvWa {
    public static void main(String[] args) {
        System.out.println("--造成的第一批人是白色人种--");
        Human whiteHuman = HumanFactory.createHuman(WhiteHuman.class);
        whiteHuman.getColor();
        whiteHuman.talk();

        System.out.println("--造成的第一批人是黑色人种--");
        Human blackHuman = HumanFactory.createHuman(BlackHuman.class);
        blackHuman.getColor();
        blackHuman.talk();

        System.out.println("--造成的第一批人是黄色人种--");
        Human yellowHuman = HumanFactory.createHuman(YellowHunam.class);
        yellowHuman.getColor();
        yellowHuman.talk();
    }
}
